home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat1 / vi.z / vi
Text File  |  1998-10-20  |  24KB  |  529 lines

  1.  
  2.  
  3.  
  4. vvvviiii((((1111))))                                                                    vvvviiii((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      vi, view, vedit - screen-oriented (visual) display editors based on ex
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      vvvviiii [----tttt tag] [----rrrr file] [----LLLL] [----wwwwn] [----RRRR] [----xxxx] [----CCCC] [----cccc command] file ...
  13.      vvvviiiieeeewwww [----tttt tag] [----rrrr file] [----LLLL] [----wwwwn] [----RRRR] [----xxxx] [----CCCC] [----cccc command] file ...
  14.      vvvveeeeddddiiiitttt [----tttt tag] [----rrrr file] [----LLLL] [----wwwwn] [----RRRR] [----xxxx] [----CCCC] [----cccc command] file ...
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      _v_i (visual) is a display-oriented text editor based on an underlying line
  18.      editor _e_x(1).  It is possible to use the command mode of _e_x from within
  19.      _v_i and vice-versa.  The visual commands are described on this manual
  20.      page; how to set options (like automatically numbering lines and
  21.      automatically starting a new output line when you type carriage return)
  22.      and all _e_x line editor commands are described on the _e_x(1) reference
  23.      page.
  24.  
  25.      When using _v_i, changes you make to the file are reflected in what you see
  26.      on your terminal screen.  The position of the cursor on the screen
  27.      indicates the position within the file.
  28.  
  29.    IIIInnnnvvvvooooccccaaaattttiiiioooonnnn OOOOppppttttiiiioooonnnnssss
  30.      The following invocation options are interpreted by _v_i (previously
  31.      documented options are discussed in the NNNNOOOOTTTTEEEESSSS section at the end of this
  32.      manual page):
  33.  
  34.      ----tttt _t_a_g        Edit the file containing the _t_a_g and position the editor at
  35.                    its definition.
  36.  
  37.      ----rrrr _f_i_l_e       Edit _f_i_l_e after an editor or system crash.  (Recovers the
  38.                    version of _f_i_l_e that was in the buffer when the crash
  39.                    occurred.)
  40.  
  41.      ----LLLL            List the name of all files saved as the result of an editor
  42.                    or system crash.
  43.  
  44.      ----wwww_n           Set the default window size to _n.  This is useful when
  45.                    using the editor over a slow speed line.
  46.  
  47.      ----RRRR            RRRReeeeaaaaddddoooonnnnllllyyyy mode; the rrrreeeeaaaaddddoooonnnnllllyyyy flag is set, preventing
  48.                    accidental overwriting of the file.
  49.  
  50.      ----xxxx            Encryption option; when used, _v_i simulates the XXXX command of
  51.                    _e_x and prompts the user for a key.  This key is used to
  52.                    encrypt and decrypt text using the algorithm of _c_r_y_p_t(1).
  53.                    The XXXX command makes an educated guess to determine whether
  54.                    text read in is encrypted or not.  The temporary buffer
  55.                    file is encrypted also, using a transformed version of the
  56.                    key typed in for the ----xxxx option.  See _c_r_y_p_t(1).
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. vvvviiii((((1111))))                                                                    vvvviiii((((1111))))
  71.  
  72.  
  73.  
  74.      ----CCCC            Encryption option; same as the ----xxxx option, except that _v_i
  75.                    simulates the CCCC command of _e_x.  The CCCC command is like the XXXX
  76.                    command of _e_x, except that all text read in is assumed to
  77.                    have been encrypted.
  78.  
  79.      ----cccc  _c_o_m_m_a_n_d   Begin editing by executing the specified editor _c_o_m_m_a_n_d
  80.                    (usually a search or positioning command).  When used with
  81.                    -_t, the specified command is given after moving to the tag.
  82.  
  83.      The _f_i_l_e argument indicates one or more files to be edited.
  84.  
  85.      The _v_i_e_w invocation is the same as _v_i except that the rrrreeeeaaaaddddoooonnnnllllyyyy flag is
  86.      set.
  87.  
  88.      The _v_e_d_i_t invocation is intended for beginners.  It is the same as _v_i
  89.      except that the rrrreeeeppppoooorrrrtttt flag is set to 1, the sssshhhhoooowwwwmmmmooooddddeeee and nnnnoooovvvviiiicccceeee flags
  90.      are set, and mmmmaaaaggggiiiicccc is turned off.  These defaults make it easier to learn
  91.      how to use _v_i.
  92.  
  93.    vvvviiii MMMMooooddddeeeessss
  94.      Command     Normal and initial mode.  Other modes return to command mode
  95.                  upon completion.  EEEESSSSCCCC (escape) is used to cancel a partial
  96.                  command.
  97.  
  98.      Input       Entered by setting any of the following options:  aaaa AAAA iiii IIII oooo OOOO
  99.                  cccc CCCC ssss SSSS RRRR ....  Arbitrary text can then be entered.  Input mode
  100.                  is normally terminated with EEEESSSSCCCC character, or, abnormally,
  101.                  with an interrupt.
  102.  
  103.      Last line   Reading input for :::: //// ???? or !!!!; terminate by typing a carriage
  104.                  return; an interrupt cancels termination.
  105.  
  106. CCCCOOOOMMMMMMMMAAAANNNNDDDD SSSSUUUUMMMMMMMMAAAARRRRYYYY
  107.      In the descriptions, CR stands for carriage return and EEEESSSSCCCC stands for the
  108.      escape key.
  109.  
  110.    SSSSaaaammmmpppplllleeee ccccoooommmmmmmmaaaannnnddddssss
  111.      <<<<---- ||||vvvv ||||^^^^ ---->>>>         arrow keys move the cursor
  112.      hhhh jjjj kkkk llll           same as arrow keys
  113.      iiii_t_e_x_tEEEESSSSCCCC          insert _t_e_x_t
  114.      ccccwwww_n_e_wEEEESSSSCCCC          change word to _n_e_w
  115.      eeeeaaaa_sEEEESSSSCCCC            pluralize word (end of word; append ssss;
  116.                        escape from input state)
  117.      xxxx                 delete a character
  118.      ddddwwww                delete a word
  119.      dddddddd                delete a line
  120.      3333dddddddd               delete 3 lines
  121.      uuuu                 undo previous change
  122.      ZZZZZZZZ                exit _v_i, saving changes
  123.      ::::qqqq!!!!CCCCRRRR             quit, discarding changes
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. vvvviiii((((1111))))                                                                    vvvviiii((((1111))))
  137.  
  138.  
  139.  
  140.      ////_t_e_x_tCCCCRRRR           search for _t_e_x_t
  141.      ^^^^UUUU ^^^^DDDD             scroll up or down
  142.      ::::_c_m_dCCCCRRRR            any _e_x or _e_d command
  143.  
  144.    CCCCoooouuuunnnnttttssss bbbbeeeeffffoooorrrreeee vvvviiii ccccoooommmmmmmmaaaannnnddddssss
  145.      Numbers can be typed as a prefix to some commands.  They are interpreted
  146.      in one of these ways.
  147.  
  148.      line/column number   zzzz  GGGG  ||||
  149.      scroll amount        ^^^^DDDD  ^^^^UUUU
  150.      repeat effect        most of the rest
  151.  
  152.    IIIInnnntttteeeerrrrrrrruuuuppppttttiiiinnnngggg,,,, ccccaaaannnncccceeeelllliiiinnnngggg
  153.       EEEESSSSCCCC       end insert or incomplete cmd
  154.       DDDDEEEELLLL       (delete or rubout) interrupts
  155.  
  156.    FFFFiiiilllleeee mmmmaaaannnniiiippppuuuullllaaaattttiiiioooonnnn
  157.       ZZZZZZZZ              if file modified, write and exit; otherwise, exit
  158.       ::::wwwwCCCCRRRR            write back changes
  159.       ::::wwww!!!!CCCCRRRR           forced write, if permission originally not valid
  160.       ::::qqqqCCCCRRRR            quit
  161.       ::::qqqq!!!!CCCCRRRR           quit, discard changes
  162.       ::::eeee _n_a_m_eCCCCRRRR       edit file _n_a_m_e
  163.       ::::eeee!!!!CCCCRRRR           reedit, discard changes
  164.       ::::eeee ++++ _n_a_m_eCCCCRRRR     edit, starting at end
  165.       ::::eeee ++++_nCCCCRRRR         edit starting at line _n
  166.       ::::eeee ####CCCCRRRR          edit alternate file
  167.       ::::eeee!!!! ####CCCCRRRR         edit alternate file, discard changes
  168.       ::::wwww _n_a_m_eCCCCRRRR       write file _n_a_m_e
  169.       ::::wwww!!!! _n_a_m_eCCCCRRRR      overwrite file _n_a_m_e
  170.       ::::sssshhhhCCCCRRRR           run shell, then return
  171.       ::::!!!!_c_m_dCCCCRRRR         run _c_m_d, then return
  172.       ::::nnnnCCCCRRRR            edit next file in arglist
  173.       ::::nnnn _a_r_g_sCCCCRRRR       specify new arglist
  174.       ^^^^GGGG              show current file and line
  175.       ::::ttttaaaagggg _t_a_gCCCCRRRR      position cursor to _t_a_g (see _c_t_a_g_s(1)), save position
  176.       ::::ppppooooppppCCCCRRRR          return to previous tag's position
  177.  
  178.      In general, any _e_x or _e_d command (such as _s_u_b_s_t_i_t_u_t_e or _g_l_o_b_a_l) can be
  179.      typed, preceded by a colon and followed by a carriage return.
  180.  
  181.    PPPPoooossssiiiittttiiiioooonnnniiiinnnngggg wwwwiiiitttthhhhiiiinnnn ffffiiiilllleeee
  182.       ^^^^FFFF          forward screen
  183.       ^^^^BBBB          backward screen
  184.       ^^^^DDDD          scroll down half screen
  185.       ^^^^UUUU          scroll up half screen
  186.       _nGGGG          go to the beginning of the specified line
  187.                   (end default), where _n is a line number
  188.       ////_p_a_t        next line matching _p_a_t
  189.       ????_p_a_t        previous line matching _p_a_t
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. vvvviiii((((1111))))                                                                    vvvviiii((((1111))))
  203.  
  204.  
  205.  
  206.       nnnn           repeat last //// or ???? command
  207.       NNNN           reverse last //// or ???? command
  208.       ////_p_a_t////++++_n     nth line after _p_a_t
  209.       ????_p_a_t????----_n     nth line before _p_a_t
  210.       ]]]]]]]]          next section/function
  211.       [[[[[[[[          previous section/function
  212.       ((((           beginning of sentence
  213.       ))))           end of sentence
  214.       {{{{           beginning of paragraph
  215.       }}}}           end of paragraph
  216.       %%%%           find matching (((( )))) {{{{ or }}}}
  217.       ^^^^]]]]          :tag command using word after the cursor as the tag
  218.       ^^^^TTTT          return to previous tag's position (:pop command)
  219.  
  220.    AAAAddddjjjjuuuussssttttiiiinnnngggg tttthhhheeee ssssccccrrrreeeeeeeennnn
  221.       ^^^^LLLL            clear and redraw window
  222.       ^^^^RRRR            clear and redraw window if ^^^^LLLL is -> key
  223.       zzzzCCCCRRRR           redraw screen with current line at top of window
  224.       zzzz----            redraw screen with current line at bottom of window
  225.       zzzz....            redraw screen with current line at center of window
  226.       ////_p_a_t////zzzz----CCCCRRRR     move _p_a_t line to bottom of window
  227.       zzzz_n....           use _n-line window
  228.       ^^^^EEEE            scroll window down 1 line
  229.       ^^^^YYYY            scroll window up 1 line
  230.  
  231.    MMMMaaaarrrrkkkkiiiinnnngggg aaaannnndddd rrrreeeettttuuuurrrrnnnniiiinnnngggg
  232.       ````````      move cursor to previous context
  233.       ''''''''      move cursor to first non-white space in line
  234.       mmmm_x      mark current position with the ASCII lower-case letter _x
  235.       ````_x      move cursor to mark _x
  236.       ''''_x      move cursor to first non-white space in line marked by _x
  237.  
  238.    LLLLiiiinnnneeee ppppoooossssiiiittttiiiioooonnnniiiinnnngggg
  239.       HHHH          top line on screen
  240.       LLLL          last line on screen
  241.       MMMM          middle line on screen
  242.       ++++          next line, at first non-white
  243.       ----          previous line, at first non-white
  244.       CCCCRRRR         return, same as +
  245.       ||||vvvv or jjjj     next line, same column
  246.       ||||^^^^ or kkkk     previous line, same column
  247.  
  248.    CCCChhhhaaaarrrraaaacccctttteeeerrrr ppppoooossssiiiittttiiiioooonnnniiiinnnngggg
  249.       ^^^^           first non white-space character
  250.       0000           beginning of line
  251.       $$$$           end of line
  252.       llll or ---->>>>     forward
  253.       hhhh or <<<<----     backward
  254.       ^^^^HHHH          same as <<<<---- (backspace)
  255.       space       same as ---->>>> (space bar)
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. vvvviiii((((1111))))                                                                    vvvviiii((((1111))))
  269.  
  270.  
  271.  
  272.       ffff_x          find next _x
  273.       FFFF_x          find previous xxxx
  274.       tttt_x          move to character prior to next _x
  275.       TTTT_x          move to character following previous _x
  276.       ;;;;           repeat last ffff FFFF tttt or TTTT
  277.       ,,,,           repeat inverse of last ffff FFFF tttt or TTTT
  278.       _n||||          move to column _n
  279.       %%%%           find matching (((( {{{{ )))) or }}}}
  280.  
  281.    WWWWoooorrrrddddssss,,,, sssseeeennnntttteeeennnncccceeeessss,,,, sssseeeeccccttttiiiioooonnnnssss,,,, aaaannnndddd ppppaaaarrrraaaaggggrrrraaaapppphhhhssss
  282.       wwww       forward a word
  283.       bbbb       back a word
  284.       eeee       end of word
  285.       ))))       to next sentence
  286.       }}}}       to next paragraph
  287.       ]]]]]]]]      next section/function
  288.       [[[[[[[[      previous section/function
  289.       ((((       back a sentence
  290.       {{{{       back a paragraph
  291.       WWWW       forward a blank-delimited word
  292.       BBBB       back a blank-delimited word
  293.       EEEE       end of a blank-delimited word
  294.  
  295.      A paragraph is a superset of a section.  In addition to the delimiters
  296.      set by the _p_a_r_a_g_r_a_p_h and _s_e_c_t_i_o_n variables, a section is defined as a
  297.      line starting with a {{{{ or a ffffoooorrrrmmmmffffeeeeeeeedddd.  A paragraph starts with those, a
  298.      blank line, or the beginning of a file.  These definitions are XXXXPPPPGGGG4444
  299.      compliant, and somewhat different than earlier releases.  To use the
  300.      older definitions, set the variable _o_l_d_p_a_r_a_g_r_a_p_h_s.
  301.  
  302.    CCCCoooorrrrrrrreeeeccccttttiiiioooonnnnssss dddduuuurrrriiiinnnngggg iiiinnnnsssseeeerrrrtttt
  303.       ^^^^HHHH        erase last character (backspace)
  304.       ^^^^WWWW        erase last word
  305.       erase     your erase character, same as ^^^^HHHH (backspace)
  306.       kill      your kill character, erase this line of input
  307.       \\\\         quotes your erase and kill characters
  308.       EEEESSSSCCCC       ends insertion, back to command mode
  309.       DDDDEEEELLLL       interrupt, terminates insert mode
  310.       ^^^^DDDD        backtab one character; reset left margin
  311.                 of _a_u_t_o_i_n_d_e_n_t
  312.       ^^^^^^^^DDDD       caret (^) followed by control-d (^D);
  313.                 backtab to beginning of line;
  314.                 do not reset left margin of _a_u_t_o_i_n_d_e_n_t
  315.       0000^^^^DDDD       backtab to beginning of line;
  316.                 reset left margin of _a_u_t_o_i_n_d_e_n_t
  317.       ^^^^TTTT        insert _s_h_i_f_t_w_i_d_t_h spaces.
  318.       ^^^^VVVV        quote non-printable character
  319.  
  320.    IIIInnnnsssseeeerrrrtttt aaaannnndddd rrrreeeeppppllllaaaacccceeee
  321.       aaaa            append after cursor
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. vvvviiii((((1111))))                                                                    vvvviiii((((1111))))
  335.  
  336.  
  337.  
  338.       AAAA            append at end of line
  339.       iiii            insert before cursor
  340.       IIII            insert before first non-blank
  341.       oooo            open line below
  342.       OOOO            open above
  343.       rrrr_x           replace single char with _x
  344.       RRRR_t_e_x_tEEEESSSSCCCC     replace characters
  345.  
  346.    OOOOppppeeeerrrraaaattttoooorrrrssss
  347.      Operators are followed by a cursor motion, and affect all text that would
  348.      have been moved over.  For example, since wwww moves over a word, ddddwwww deletes
  349.      the word that would be moved over.  Double the operator, for example, dddddddd
  350.      to affect whole lines.
  351.  
  352.       dddd       delete
  353.       cccc       change
  354.       yyyy       yank lines to buffer
  355.       <<<<       left shift
  356.       >>>>       right shift
  357.       !!!!       filter through command
  358.  
  359.    MMMMiiiisssscccceeeellllllllaaaannnneeeeoooouuuussss OOOOppppeeeerrrraaaattttiiiioooonnnnssss
  360.       CCCC       change rest of line (cccc$$$$)
  361.       DDDD       delete rest of line (dddd$$$$)
  362.       ssss       substitute chars (ccccllll)
  363.       SSSS       substitute lines (cccccccc)
  364.       JJJJ       join lines
  365.       xxxx       delete characters (ddddllll)
  366.       XXXX       delete characters before cursor (ddddhhhh)
  367.       YYYY       yank lines (yyyyyyyy)
  368.  
  369.    YYYYaaaannnnkkkk aaaannnndddd PPPPuuuutttt
  370.      Put inserts the text most recently deleted or yanked; however, if a
  371.      buffer is named (using the ASCII lower-case letters aaaa-zzzz), the text in
  372.      that buffer is put instead.
  373.  
  374.       3333yyyyyyyy     yank 3 lines
  375.       3333yyyyllll     yank 3 characters
  376.       pppp       put back text after cursor
  377.       PPPP       put back text before cursor
  378.       """"_xpppp     put from buffer _x
  379.       """"_xyyyy     yank to buffer _x
  380.       """"_xdddd     delete into buffer _x
  381.  
  382.    UUUUnnnnddddoooo,,,, RRRReeeeddddoooo,,,, RRRReeeettttrrrriiiieeeevvvveeee
  383.       uuuu       undo last change
  384.       UUUU       restore current line
  385.       ....       repeat last change
  386.       """"_dpppp     retrieve _d'th last delete
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. vvvviiii((((1111))))                                                                    vvvviiii((((1111))))
  401.  
  402.  
  403.  
  404. AAAAUUUUTTTTHHHHOOOORRRR
  405.      _v_i and _e_x were developed by The University of California, Berkeley
  406.      California, Computer Science Division, Department of Electrical
  407.      Engineering and Computer Science.
  408.  
  409. FFFFIIIILLLLEEEESSSS
  410.      /tmp   default directory where temporary work files are placed; it can be
  411.             changed using the ddddiiiirrrreeeeccccttttoooorrrryyyy option (see the _e_x sssseeeetttt command)
  412.      /usr/share/lib/terminfo/?/*
  413.             compiled terminal description database
  414.  
  415. NNNNOOOOTTTTEEEESSSS
  416.      Two options, although they continue to be supported, have been replaced
  417.      in the documentation by options that follow the Command Syntax Standard
  418.      (see _i_n_t_r_o(1)).  A ----rrrr option that is not followed with an option-argument
  419.      has been replaced by ----LLLL and ++++_c_o_m_m_a_n_d has been replaced by ----cccc _c_o_m_m_a_n_d.
  420.  
  421.      _v_i has a limit of 15,687,678 editable lines.  Attempts to edit or create
  422.      files larger than this limit cause _v_i to terminate with an appropriate
  423.      error message.  There is also a limit of 8192 bytes per line (languages
  424.      with multibyte characters may therefore have fewer than 8192 characters
  425.      per line; otherwise this is also the number of characters per line.
  426.      Files with longer lines are not edittable (or even viewable) with this
  427.      editor.  Use of either _f_o_l_d(1) or _f_m_t(1) on the file (while changing the
  428.      contents) can be used to avoid this limit.
  429.  
  430.      Several changes have been made and bugs fixed for XXXXPPPPGGGG4444 compliance.  See
  431.      the discussion about _p_a_r_a_g_r_a_p_h_s above, for one case.  Additionally, the eeee
  432.      (move to end of word) command had bugs skipping over single letter words,
  433.      and skipped one to few words, when the current position was the last
  434.      letter in a word.  Formerly, the ordering of the ----cccc and ----tttt options was
  435.      not defined, and the command was executed before moving to the tag.  The
  436.      order is now reversed.  If a file is readonly, the !!!! override must now be
  437.      used whenever you write the file, not just the first time.
  438.  
  439.      Tampering with entries in /_u_s_r/_l_i_b/_t_e_r_m_i_n_f_o/?/* (for example, changing or
  440.      removing an entry) can affect programs such as that expect the entry to
  441.      be present and correct.  In particular, removing the "dumb" terminal may
  442.      cause unexpected problems.
  443.  
  444.      The regular expression has been changed to XPG4 compliance, please see
  445.      regcomp(5).
  446.  
  447. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  448.      ctags(1), ed(1), edit(1), ex(1), regcomp(5), vi(1).
  449.  
  450. BBBBUUUUGGGGSSSS
  451.      In insert mode, software tabs using ^^^^TTTT work only immediately after the
  452.      aaaauuuuttttooooiiiinnnnddddeeeennnntttt.
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. vvvviiii((((1111))))                                                                    vvvviiii((((1111))))
  467.  
  468.  
  469.  
  470.      Left and right shifts on intelligent terminals do not make use of insert
  471.      and delete character operations in the terminal.
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.